package http

import (
	"log"
)

// ========================================
// HTTP协议工厂
// 实现 protocols.ProtocolFactory 接口
// ========================================

// Factory HTTP协议处理器工厂
type Factory struct{}

// CreateHandler 创建HTTP协议处理器
func (f *Factory) CreateHandler(tunnelID, targetHost, targetPort string) (*Handler, error) {
	log.Printf("🏭 [HTTP工厂] 创建HTTP处理器: target=%s:%s", targetHost, targetPort)
	return NewHandler(tunnelID, targetHost, targetPort), nil
}

// SupportedProtocol 返回支持的协议类型
func (f *Factory) SupportedProtocol() uint8 {
	return 1 // ProtocolHTTP
}

// NewFactory 创建HTTP工厂实例
func NewFactory() *Factory {
	return &Factory{}
}
